/**
 * Copyright &copy; 2015-2020 <a href="http://www.easyhis.com/">easyhis</a> All rights reserved.
 */
package com.easy.dfcapi.entity;

import com.easy.common.utils.excel.annotation.ExcelField;
import com.easy.core.persistence.BaseEntity;
import com.easy.modules.sys.entity.User;
import com.fasterxml.jackson.annotation.JsonFormat;

import javax.validation.constraints.NotNull;
import java.util.Date;

/**
 * 日志Entity
 * @author waylen chi
 * @version 2018-01-02
 */
public class ApiLog extends BaseEntity<ApiLog> {
	
	private static final long serialVersionUID = 1L;
	private Integer logId;		// 编号
	private String logType;		// 日志类型
	private String logTitle;		// 日志标题
	private User createBy;		// 创建者
	private Date createTime;		// 创建时间
	private String remoteAddr;		// 操作IP地址
	private String userAgent;		// 用户代理
	private String requestUri;		// 请求URI
	private String method;		// 操作方式
	private String params;		// 操作提交的数据
	private String exception;		// 异常信息
	private String froms;		// 设备
	
	public ApiLog() {
		super();
	}

	public ApiLog(Integer logId){
		this.logId = logId;
	}

	@NotNull(message="编号不能为空")
	@ExcelField(title="编号", align=2, sort=0)
	public Integer getLogId() {
		return logId;
	}

	public void setLogId(Integer logId) {
		this.logId = logId;
	}
	
	@ExcelField(title="日志类型", align=2, sort=1)
	public String getLogType() {
		return logType;
	}

	public void setLogType(String logType) {
		this.logType = logType;
	}
	
	@ExcelField(title="日志标题", align=2, sort=2)
	public String getLogTitle() {
		return logTitle;
	}

	public void setLogTitle(String logTitle) {
		this.logTitle = logTitle;
	}
	
	@ExcelField(title="创建者", align=2, sort=3)
	public User getCreateBy() {
		return createBy;
	}

	public void setCreateBy(User createBy) {
		this.createBy = createBy;
	}
	
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
	@ExcelField(title="创建时间", align=2, sort=4)
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}
	
	@ExcelField(title="操作IP地址", align=2, sort=5)
	public String getRemoteAddr() {
		return remoteAddr;
	}

	public void setRemoteAddr(String remoteAddr) {
		this.remoteAddr = remoteAddr;
	}
	
	@ExcelField(title="用户代理", align=2, sort=6)
	public String getUserAgent() {
		return userAgent;
	}

	public void setUserAgent(String userAgent) {
		this.userAgent = userAgent;
	}
	
	@ExcelField(title="请求URI", align=2, sort=7)
	public String getRequestUri() {
		return requestUri;
	}

	public void setRequestUri(String requestUri) {
		this.requestUri = requestUri;
	}
	
	@ExcelField(title="操作方式", align=2, sort=8)
	public String getMethod() {
		return method;
	}

	public void setMethod(String method) {
		this.method = method;
	}
	
	@ExcelField(title="操作提交的数据", align=2, sort=9)
	public String getParams() {
		return params;
	}

	public void setParams(String params) {
		this.params = params;
	}
	
	@ExcelField(title="异常信息", align=2, sort=10)
	public String getException() {
		return exception;
	}

	public void setException(String exception) {
		this.exception = exception;
	}
	
	@ExcelField(title="设备", align=2, sort=11)
	public String getFroms() {
		return froms;
	}

	public void setFroms(String froms) {
		this.froms = froms;
	}
	
}